<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/25
 * Time: 9:09
 */

function abc(){
    $age=-1;
    if($age<0){
        $x=new Exception("有人把你的年龄改为负数");
         throw $x;
     }else{
        echo 'm';
    }
    echo 'x';
}
try{
    abc();
    echo 'h';
}catch(Exception $e){
    echo $e->getMessage();
  }
